package com.fengye.algorithms.huawei;

import java.util.Scanner;

/**
 * @Author fengye
 * @Date 2023/4/7 11:38
 **/
public class LowestCommonMultipleMain {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            int b = in.nextInt();

            if(a == b){
                System.out.println(a);
                return;
            }

            if(a > b) {
                int t = a;
                a = b;
                b = t;
            }

            if(b % a == 0) {
                System.out.println(b);
                return;
            }

            System.out.println(a * b / getGys(a,b));
        }
    }

    /**
     * 求出最大公约数
     * @param a
     * @param b
     * @return
     */
    public static int getGys(int a, int b) {
        while(b % a != 0) {
            int temp = b % a;
            b=a;
            a=temp;
        }
        return a;
    }
}
